From baa7cb664e662cee23cdad92c78d9c14cab2445d Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Wed, 3 May 2023 15:19:35 +0700
Subject: add whatsapp widget and page not found

---
 src/pages/shop/product/[slug].jsx | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'src/pages/shop/product/[slug].jsx')

diff --git a/src/pages/shop/product/[slug].jsx b/src/pages/shop/product/[slug].jsx
index ed6c27d5..cdba90c0 100644
--- a/src/pages/shop/product/[slug].jsx
+++ b/src/pages/shop/product/[slug].jsx
@@ -2,6 +2,7 @@ import Seo from '@/core/components/Seo'
 import LogoSpinner from '@/core/components/elements/Spinner/LogoSpinner'
 import { getIdFromSlug } from '@/core/utils/slug'
 import productApi from '@/lib/product/api/productApi'
+import PageNotFound from '@/pages/404'
 import dynamic from 'next/dynamic'
 import { useRouter } from 'next/router'
 
@@ -32,6 +33,8 @@ export async function getServerSideProps(context) {
 export default function ProductDetail({ product }) {
   const router = useRouter()
 
+  if (!product) return <PageNotFound />
+
   return (
     <BasicLayout>
       <Seo
-- 
cgit v1.2.3

